ci: increase page size of GH PR API call#13518
Conversation
zhaoyongjie
left a comment
There was a problem hiding this comment.
LGTM
the default pagination for Github is 30.
https://docs.github.com/en/rest/overview/resources-in-the-rest-api#pagination
| fi | ||
|
|
||
| URL="https://api.github.com/repos/${GITHUB_REPO}/pulls/${PR_NUMBER}/files" | ||
| URL="https://api.github.com/repos/${GITHUB_REPO}/pulls/${PR_NUMBER}/files?per_page=1000" |
There was a problem hiding this comment.
Looks like I'm late to the party again. The maximum per_page size is 100 according to the document, although I'd assume we won't regularly exceed that limit anyway.
To obtain more than 100 items, there is a convenient pagination helper in GitHub script.
This PR has an example.
For convenience and future extensibility, we might want to convert this file to GitHub script the next time we touch it.
There was a problem hiding this comment.
I was actually intending to make a cleaner solution, this is to unblock immediate PRs suffering from this. I'll fix this properly this week.
SUMMARY
When working on #13484 I noticed that the script that checks for python and frontend changes in the PR wasn't picking up changes to python files:
Turns out GH API calls are paginated. After adding the
per_pagequery parameter the full set of changes were reported:BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
ADDITIONAL INFORMATION